<template>
  <div class="cart-list">
    <Scroll class="content" ref="scroll" >

      <cart-list-item
        v-for="(item, index) in cartList"
        :product="item" :key="index" />
    </Scroll>
  </div>
</template>

<script>
import Scroll from "../../../components/common/scroll/Scroll";
import {mapGetters} from 'vuex'
import CartListItem from "./CartListItem";

export default {
  name: "CartList",
  components:{
    Scroll,
    CartListItem
  },
  computed:{
    ...mapGetters(['cartList'])
  },
  activated() {
    //每次到购物车界面都刷新一次高度
    this.$refs.scroll.refresh()
  }
}
</script>

<style scoped>

  .cart-list{
    height: calc(100vh  - 44px - 49px - 40px);
  }

 .content{
   height: calc(100% );
   overflow: hidden;
 }
</style>
